home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / k3baudiooutputplugin.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  1.6 KB  |  70 lines

  1. /* 
  2.  *
  3.  * $Id: k3baudiooutputplugin.h 619556 2007-01-03 17:38:12Z trueg $
  4.  * Copyright (C) 2004 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16. #ifndef _K3B_AUDIO_OUTPUTPLUGIN_H_
  17. #define _K3B_AUDIO_OUTPUTPLUGIN_H_
  18.  
  19. #include <k3bplugin.h>
  20. #include "k3b_export.h"
  21.  
  22. /**
  23.  *
  24.  */
  25. class LIBK3B_EXPORT K3bAudioOutputPlugin : public K3bPlugin
  26. {
  27.   Q_OBJECT
  28.  
  29.  public:
  30.   virtual ~K3bAudioOutputPlugin() {
  31.   }
  32.  
  33.   QString group() const { return "AudioOutput"; }
  34.  
  35.   /**
  36.    * This is the short name of the sound system which can be used
  37.    * to specify the sound system on the command line (like "arts", "alsa", or "oss")
  38.    */
  39.   virtual QCString soundSystem() const = 0;
  40.  
  41.   /**
  42.    * Initialize the plugin.
  43.    *
  44.    * Return true on success.
  45.    * In case of a failure report the error through lastErrorMessage
  46.    */
  47.   virtual bool init() { return true; }
  48.  
  49.   /**
  50.    * Cleanup the plugin. This is the counterpart to init()
  51.    */
  52.   virtual void cleanup() {}
  53.  
  54.   virtual QString lastErrorMessage() const { return QString::null; }
  55.  
  56.   /**
  57.    * Let there be sound...
  58.    *
  59.    * @returns number of written bytes or -1 on error.
  60.    */
  61.   virtual int write( char* data, int len ) = 0;
  62.  
  63.  protected:
  64.   K3bAudioOutputPlugin( QObject* parent = 0, const char* name = 0 )
  65.     : K3bPlugin( parent, name ) {
  66.   }
  67. };
  68.  
  69. #endif
  70.